import { createI18n } from 'vue-i18n'
import zhCn from './zhCn'
const language = (navigator.language || navigator.browserLanguage).toLowerCase().includes('zh')
  ? 'zh-cn'
  : 'en'

const messages = { 'zh-cn': zhCn }

const i18n = createI18n({
  fallbackLocale: 'zh-cn',
  locale: language, //默认显示的语言
  globalInjection: true,
  messages,
  legacy: false // you must specify 'legacy: false' option
})

export default i18n
